﻿using FastExecutor.Base.Design;
using FastExecutor.Base.Model;
using FastExecutor.ORG.DB;
using FastIOC.Annotation;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Mvc;

namespace FastExecutor.ORG.Controller
{
    [RouteArea("Frame")]
    [RoutePrefix("Home")]
    public class HomeController : BaseController
    {
        [AutoWired]
        private DB_Config @DB_Config;

        [Route("Index")]
        public ActionResult Index()
        {
            ViewData["SystemName"] = System.Configuration.ConfigurationManager.AppSettings["SystemName"];
            return View("~/Views/Frame/Home/Index.cshtml");
        }

        [Route("Login")]
        public ActionResult Login()
        {
            ViewData["SystemName"] = System.Configuration.ConfigurationManager.AppSettings["SystemName"];
            return View("~/Views/Frame/Home/Login.cshtml");
        }

        [Route("MainPage")]
        public ActionResult MainPage()
        {
            return View("~/Views/Frame/Home/MainPage.cshtml");
        }

        [Route("GetSettingInfo")]
        public ActionResult GetSettingInfo()
        {
            ReturnValue returnvalue = new ReturnValue();
            //DefaultMainIndex为第一个默认Tab页的路由
            returnvalue.Add("defaultmainindex", @DB_Config.GetConfigValue("DefaultMainIndex"));
            return returnvalue;
        }
    }
}
